package com.wss.day07.loginException;

/**
 * @author wangshaoshuai
 * @desc TODO
 * @date 2025/4/28
 */
public class LoginService {
    public static void login(String account, String password) throws LoginException {
        if (account == null || account.isEmpty() || password == null || password.isEmpty()) {
            throw new LoginException("账户或密码不能为空");
        }

        String correctAccount = "admin";
        String correctPassword = "123456";
        if (!account.equals(correctAccount) ||!password.equals(correctPassword)) {
            throw new LoginException("账户与密码不匹配");
        }
        System.out.println("登录成功");
    }
}
